package com.yanqu.road.entity.activity.advertisement.config;

import com.yanqu.road.entity.activity.ActivityConfig;

import java.util.List;
import java.util.Map;

public class AdvertisementConfig {
    //跳过观看广告的条件（0关闭不能跳过1月卡2年卡）
    private int skipType;
    //累计观看广告的开启条件—玩家身份最小值
    private int totalWatchMinLevel;
    //累计观看广告奖励的活动时间/day
    private int totalWatchRewardActiveDay;
    //商铺小人礼包刷新时间/h 0点开算
    private int shopNpcRefreshCd;
    //商铺小人礼包刷新权重
    private List<Integer> shopNpcRefreshWeight;

    //【登陆】限时礼包--触发条件，登陆xx秒后
    private int loginTriggerCond;
    //【登陆/新服七日签到】限时礼包--触发后存在时间/s
    private long existTime;

    private Map<Integer,AdvertisementSystemConfig> systemConfigMap;

    public AdvertisementConfig(Map<Integer, AdvertisementSystemConfig> systemConfigMap,Map<String, ActivityConfig> configMap) {
        this.systemConfigMap = systemConfigMap;
        this.skipType =  configMap.get("SYSTEM_CD_JUMP_COND").getIntValue();
        this.totalWatchMinLevel =  configMap.get("SYSTEM_CD_ACHIEVEMENT_OPEN_COND").getIntValue();
        this.totalWatchRewardActiveDay =  configMap.get("SYSTEM_CD_ACHIEVEMENT_CONTINUED_TIME").getIntValue();
        this.shopNpcRefreshCd =  configMap.get("SYSTEM_CD_SHOP_GIFT_REFRESH_CD").getIntValue();
        this.shopNpcRefreshWeight = configMap.get("SYSTEM_CD_SHOP_GIFT_REFRESH_WEIGHTS").getIntListValue("\\|");
        if(configMap.containsKey("SYSTEM_CD_LIMITED_BAG_TRIGGER_COND")) {
            this.loginTriggerCond = configMap.get("SYSTEM_CD_LIMITED_BAG_TRIGGER_COND").getIntValue();
        }
        if(configMap.containsKey("SYSTEM_CD_LIMITED_BAG_EXIST_TIME")) {
            this.existTime =  configMap.get("SYSTEM_CD_LIMITED_BAG_EXIST_TIME").getLongValue();
        }
    }

    public int getSkipType() {
        return skipType;
    }

    public int getTotalWatchMinLevel() {
        return totalWatchMinLevel;
    }

    public int getTotalWatchRewardActiveDay() {
        return totalWatchRewardActiveDay;
    }

    public Map<Integer, AdvertisementSystemConfig> getSystemConfigMap() {
        return systemConfigMap;
    }

    public int getShopNpcRefreshCd() {
        return shopNpcRefreshCd;
    }

    public List<Integer> getShopNpcRefreshWeight() {
        return shopNpcRefreshWeight;
    }

    public int getLoginTriggerCond() {
        return loginTriggerCond;
    }

    public void setLoginTriggerCond(int loginTriggerCond) {
        this.loginTriggerCond = loginTriggerCond;
    }

    public long getExistTime() {
        return existTime;
    }

    public void setExistTime(long existTime) {
        this.existTime = existTime;
    }
}
